<script setup lang="ts">
import {useRoute, useRouter} from 'vue-router'
import {computed, ref} from 'vue'
import DialogCancelConfirm from "@/components/dialog/DialogCancelConfirm.vue";
import DialogConfirm from "@/components/dialog/DialogConfirm.vue";
import ChargebackDialog from "@/components/dialog/ChargebackDialog.vue";
import { showDialog } from 'vant';
const route = useRoute()
const router = useRouter()

// 使用 computed 可以方便地设置默认值
const version = computed(() => route.query.version || '默认版本')

// console.log(utilStr);  // 输出 6W9jS0
const  isDialogVisible= ref(false);
function  clickJieDan(){
  isDialogVisible.value = !isDialogVisible.value;
  // print('isDialogVisible=',isDialogVisible.value)
  // showDialog({
  //   title: '标题',
  //   message: '代码是写出来给人看的，附带能在机器上运行。',
  //   theme: 'round-button',
  // }).then(() => {
  //   alert('aaaa')
  // });

}

function onClickCancel(dilog_visible) {
  console.log('1dilog_visible=',dilog_visible);
  isDialogVisible.value = !isDialogVisible.value;
}
function onClickConfirm(dilog_visible) {
  console.log('2dilog_visible=',dilog_visible);
  isDialogVisible.value = !isDialogVisible.value;
  // router.push(
  //     {path:'/zf',query:{money:30}}
  // )
}
</script>

<template>
<!--<div style="-->
<!--height: 100vh;width: 100vw;line-height: 100vh;-->
<!--background-color: #ffe482;">-->
<!--  当前版本是：{{ version }}-b-->
<!--</div>-->
<div @click="clickJieDan">确定取消按钮</div>
<!--  <DialogCancelConfirm v-model:visible="isDialogVisible"-->
<!--                       :money="100"-->
<!--                       @onClickCancel="onClickCancel"-->
<!--                       @onClickConfirm="onClickConfirm"/>-->

<!--      <DialogConfirm v-model:visible="isDialogVisible"-->
<!--                           :money="100"-->
<!--                           @onClickCancel="onClickCancel"-->
<!--                           @onClickConfirm="onClickConfirm"/>-->
  <ChargebackDialog  v-if="isDialogVisible"  @onClickCancel="onClickCancel" @onClickConfirm="onClickConfirm"/>

</template>

<style scoped lang="less">

</style>